const Controller = require('egg').Controller

class ClazzController extends Controller{
    async index(){
        let clazzList = await this.app.model.Clazz.findAll()
        this.ctx.body = clazzList
    }
    async create(){
        let name = this.ctx.request.body;
        await this.app.model.Clazz.create(name)
        this.ctx.body = "添加成功"
    }
}
module.exports = ClazzController